#pragma once

#include <QString>
#include <osg\ref_ptr>
#include "corebase_global.h"
#include "actorproperty.h"
#include <osg/Referenced>
#include <QMap>
#include <QVector>

namespace CoreBase
{
   class COREBASE_EXPORT PropertyContainer: public osg::Referenced
   {
   public:
      PropertyContainer();
      void getPropertyList(QVector<ActorProperty*>& proplist);
      void getPropertyList(QVector<const ActorProperty *>& proplist) const;
      void addProperty(ActorProperty* newprop);
      void insertProperty(ActorProperty* newprop, int index);
      ActorProperty* getProperty(const QString& name);
      const ActorProperty* getProperty(const QString& name) const;
      void copyPropertiesFrom(const PropertyContainer& copyfrom);
   protected:
      virtual ~PropertyContainer();
      void removeProperty(const QString& nametoremove);
   private:
      typedef QMap<QString, osg::ref_ptr<ActorProperty> > PropertyMapType;
      typedef QVector<osg::ref_ptr<ActorProperty> > PropertyVectorType;
      PropertyMapType _propertyMap;
      PropertyVectorType _properties;
   };
}